<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>Political Classifier: PoliticalClassifier.Web.Controllers.MainController Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Political_chart.svg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Political Classifier
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Software model for classification of political persuasion in world governmental elections.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Properties</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PoliticalClassifier.Web.Controllers.MainController Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The main controller for the Political Classifier MVC application.  
 <a href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for PoliticalClassifier.Web.Controllers.MainController:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.png" usemap="#PoliticalClassifier.Web.Controllers.MainController_map" alt=""/>
  <map id="PoliticalClassifier.Web.Controllers.MainController_map" name="PoliticalClassifier.Web.Controllers.MainController_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2318d1f1943edbad2e20ff5378dc13f0"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#a2318d1f1943edbad2e20ff5378dc13f0">LoadFile</a> ()</td></tr>
<tr class="memdesc:a2318d1f1943edbad2e20ff5378dc13f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays the LoadFile view.  <a href="#a2318d1f1943edbad2e20ff5378dc13f0">More...</a><br/></td></tr>
<tr class="separator:a2318d1f1943edbad2e20ff5378dc13f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb14a2ed81250eb1fd2dec463993ba00"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#aeb14a2ed81250eb1fd2dec463993ba00">LoadFile</a> (<a class="el" href="class_political_classifier_1_1_web_1_1_models_1_1_load_file_view_model.html">LoadFileViewModel</a> model)</td></tr>
<tr class="memdesc:aeb14a2ed81250eb1fd2dec463993ba00"><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays the LoadFile view with errors, or redirects to DisplayResults.  <a href="#aeb14a2ed81250eb1fd2dec463993ba00">More...</a><br/></td></tr>
<tr class="separator:aeb14a2ed81250eb1fd2dec463993ba00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19bcc444550bbd3f60bdda2df2c01c7d"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#a19bcc444550bbd3f60bdda2df2c01c7d">FileTooBig</a> ()</td></tr>
<tr class="memdesc:a19bcc444550bbd3f60bdda2df2c01c7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays a message that the uploaded file was too large on the LoadFile view.  <a href="#a19bcc444550bbd3f60bdda2df2c01c7d">More...</a><br/></td></tr>
<tr class="separator:a19bcc444550bbd3f60bdda2df2c01c7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad299f9232a20f55b2a245d7378a64e44"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#ad299f9232a20f55b2a245d7378a64e44">DisplayResults</a> ()</td></tr>
<tr class="memdesc:ad299f9232a20f55b2a245d7378a64e44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays the DisplayResults view for collecting simulation settings.  <a href="#ad299f9232a20f55b2a245d7378a64e44">More...</a><br/></td></tr>
<tr class="separator:ad299f9232a20f55b2a245d7378a64e44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd854fb463ca59c4543d7ced77913fd2"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#acd854fb463ca59c4543d7ced77913fd2">DisplayResults</a> (<a class="el" href="class_political_classifier_1_1_web_1_1_models_1_1_display_results_view_model.html">DisplayResultsViewModel</a> model)</td></tr>
<tr class="memdesc:acd854fb463ca59c4543d7ced77913fd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Displays the DisplayResults view for collecting simulation settings.  <a href="#acd854fb463ca59c4543d7ced77913fd2">More...</a><br/></td></tr>
<tr class="separator:acd854fb463ca59c4543d7ced77913fd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a799b80a0631ace186a54decc41d6c7b6"><td class="memItemLeft" align="right" valign="top">ActionResult&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html#a799b80a0631ace186a54decc41d6c7b6">DisplayPlot</a> ()</td></tr>
<tr class="memdesc:a799b80a0631ace186a54decc41d6c7b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a graphical plot image.  <a href="#a799b80a0631ace186a54decc41d6c7b6">More...</a><br/></td></tr>
<tr class="separator:a799b80a0631ace186a54decc41d6c7b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The main controller for the Political Classifier MVC application. </p>
<p>This controller controls the main flow of the Political Classifier MVC application. The primary control flow is as follows:</p>
<ol>
<li>
Display the LoadFile view for uploading a data file.  </li>
<li>
Display the blank DisplayResults view for setting simulation weights and parties.  </li>
<li>
Display the DisplayResults view with the current simulation settings and the results of the simulation.  </li>
</ol>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a799b80a0631ace186a54decc41d6c7b6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.DisplayPlot </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Generates a graphical plot image. </p>
<p>Preconditions:</p>
<ul>
<li>
Data file has been uploaded to server.  </li>
<li>
PoliticalClassifierModeler has been stored in the Session object with the key <code>Modeler</code>.  </li>
<li>
Simulation weights have been set in PoliticalClassifierModeler.  </li>
<li>
Simulation has been run using PoliticalClassifierModeler.  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
Data file remains stored on server.  </li>
<li>
The PoliticalClassifierModeler remains stored in the Session object with the key <code>Modeler</code>.  </li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>A System.Web.Mvc.FileContentResult object containing the binary data for the plotted graph image.</dd></dl>

</div>
</div>
<a class="anchor" id="ad299f9232a20f55b2a245d7378a64e44"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.DisplayResults </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Displays the DisplayResults view for collecting simulation settings. </p>
<p>This action expects the PoliticalClassifierModeler to be stored in the Session. If the PoliticalClassifierModeler is not found in the Session, the user is shown the LoadFile view along with a message indicating that his session had expired.</p>
<p>If the PoliticalClassifierModeler is found in the Session, this action displays a view that allows the user to set voter attribute weights and party coordinates for the simulation. This view will also display any warning messages concerning the processing of the data file, such as discarded rows. The view is bound to a DisplayResultsViewModel for transfering the simulation settings.</p>
<p>Preconditions:</p>
<ul>
<li>
Data file is stored on server.  </li>
<li>
The data file is loaded and processed by the PoliticalClassifierModeler.  </li>
<li>
The PoliticalClassifierModeler is stored in the Session under the key <code>Modeler</code>.  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
Data file is still stored on server.  </li>
<li>
The PoliticalClassifierModeler is still stored in the Session under the key <code>Modeler</code>.  </li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>The DisplayResults view.</dd></dl>

</div>
</div>
<a class="anchor" id="acd854fb463ca59c4543d7ced77913fd2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.DisplayResults </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_political_classifier_1_1_web_1_1_models_1_1_display_results_view_model.html">DisplayResultsViewModel</a>&#160;</td>
          <td class="paramname"><em>model</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Displays the DisplayResults view for collecting simulation settings. </p>
<p>This action expects the PoliticalClassifierModeler to be stored in the Session. If the PoliticalClassifierModeler is not found in the Session, the user is shown the LoadFile view along with a message indicating that his session had expired.</p>
<p>If the PoliticalClassifierModeler is found in the Session, this action displays a view that allows the user to set voter attribute weights and party coordinates for the simulation. This view will also display the results of a successfully run simulation or any errors in the submitted simulation settings. The view is bound to a DisplayResultsViewModel for transfering the simulation settings and results.</p>
<p>Preconditions:</p>
<ul>
<li>
Data file is stored on server.  </li>
<li>
The data file is loaded and processed by the PoliticalClassifierModeler.  </li>
<li>
The PoliticalClassifierModeler is stored in the Session under the key <code>Modeler</code>.  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
Data file is still stored on server.  </li>
<li>
The PoliticalClassifierModeler is still stored in the Session under the key <code>Modeler</code>.  </li>
<li>
Simulation weights have been set in PoliticalClassifierModeler.  </li>
<li>
Simulation parties have been set in PoliticalClassifierModeler.  </li>
<li>
Simulation has been run using PoliticalClassifierModeler.  </li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>A DisplayResultsViewModel containing the simulation settings.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The DisplayResults view.</dd></dl>

</div>
</div>
<a class="anchor" id="a19bcc444550bbd3f60bdda2df2c01c7d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.FileTooBig </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Displays a message that the uploaded file was too large on the LoadFile view. </p>
<p>If the user attempts to upload a file that is larger than the request length limit, an exception is thrown. The application then discards this exception and transfers execution into this action. This action re-displays the LoadFile view to the user, along with a message indicating that the previously posted file was too large.</p>
<p>Preconditions:</p>
<ul>
<li>
None  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
None  </li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>The LoadFile view.</dd></dl>

</div>
</div>
<a class="anchor" id="a2318d1f1943edbad2e20ff5378dc13f0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.LoadFile </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Displays the LoadFile view. </p>
<p>This action displays a view that allows the user to choose a data file on his local machine to upload to the server. The view is bound to a LoadFileViewModel for uploading the data file.</p>
<p>Preconditions:</p>
<ul>
<li>
None  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
None  </li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>The LoadFile view.</dd></dl>

</div>
</div>
<a class="anchor" id="aeb14a2ed81250eb1fd2dec463993ba00"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ActionResult PoliticalClassifier.Web.Controllers.MainController.LoadFile </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_political_classifier_1_1_web_1_1_models_1_1_load_file_view_model.html">LoadFileViewModel</a>&#160;</td>
          <td class="paramname"><em>model</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Displays the LoadFile view with errors, or redirects to DisplayResults. </p>
<p>This action validates and processes the posted data file. If there are any errors in the data file, the LoadFile view is redisplayed with a list of all errors. If the data file is error-free, the user is redirected to M:PoliticalClassifier.Web.Controllers.MainController.DisplayResults.</p>
<p>Preconditions:</p>
<ul>
<li>
None  </li>
</ul>
<p>Postconditions:</p>
<ul>
<li>
Data file is stored on server.  </li>
<li>
A PoliticalClassifierModeler is created for running the simulation.  </li>
<li>
The data file is loaded and processed by the PoliticalClassifierModeler.  </li>
<li>
The PoliticalClassifierModeler is stored in the Session under the key <code>Modeler</code>.  </li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>A LoadFileViewModel with the posted file.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The LoadFile view or a redirect to DisplayResults.</dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>C:/Users/Jonathan.DeCarlo/Source/Repos/PoliticalClassifier/src/PoliticalClassifier.Web/Controllers/MainController.cs</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_political_classifier.html">PoliticalClassifier</a></li><li class="navelem"><a class="el" href="namespace_political_classifier_1_1_web.html">Web</a></li><li class="navelem"><a class="el" href="namespace_political_classifier_1_1_web_1_1_controllers.html">Controllers</a></li><li class="navelem"><a class="el" href="class_political_classifier_1_1_web_1_1_controllers_1_1_main_controller.html">MainController</a></li>
    <li class="footer">Generated on Mon Jul 29 2013 20:06:40 for Political Classifier by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.4 </li>
  </ul>
</div>
</body>
</html>
